<?php
use yii\helpers\Url;

$web = Url::base();
$integral_unit = \app\models\Mall::getCurrentInstitutionIntegralUnit();
$site_name = \app\models\Mall::getCurrentInstitutionSiteName();
$institution_code = \app\models\Mall::getCurrentInstitutionCode();
$this->title = $site_name.'->订单列表';
?>
<link rel="stylesheet" type="text/css" href="<?= $web ?>/css/mall/user-order.css"/>
<script type="application/javascript">
    $(function ($) {
        loadOrderList(1);
    });
    function loadOrderList(page) {
        var data = {};
        data.page = page;
        requestHtml("order-list-part-view", data, true, function (responsehtml) {
            $("#order_list").html(responsehtml);
        });
    }

    function prePage() {
        var currentPage = $("#txtCurrentPage").val();
        if (currentPage != null && currentPage != '' && currentPage > 1) {
            currentPage--;
            loadOrderList(currentPage);
        }
    }

    function nextPage() {
        var max_page = $("#hidden_max_page").val();
        var currentPage = $("#txtCurrentPage").val();
        if (currentPage != null && currentPage != '' && currentPage < max_page) {
            currentPage++;
            loadOrderList(currentPage);
        }
    }

</script>

<div class="my-information">
    <div class="menu fl">
        <ul>
            <li><a href="user-information?institution_code=<?= $institution_code ?>">个人信息</a></li>
            <li><a href="user-card?institution_code=<?= $institution_code ?>">我的卡卷</a></li>
            <li><a href="user-present?institution_code=<?= $institution_code ?>"><?= $integral_unit ?>转赠</a></li>
            <li><a href="javascript:void(0)" class="cur">我的订单</a></li>
            <li><a href="user-account-record?institution_code=<?= $institution_code ?>">我的<?= $integral_unit ?></a></li>
            <li><a href="user-address?institution_code=<?= $institution_code ?>">收货地址</a></li>
        </ul>
    </div>
    <div class="data fl">
        <div class="title">
            <p>我的订单</p>
        </div>
        <div id="order_list">
        </div>
    </div>
</div>